package com.hunktimes.wholesale.ui.pages

import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hunktimes.wholesale.R
import com.hunktimes.wholesale.base.BasePageFragment
import com.hunktimes.wholesale.databinding.FragmentOrderDetailBinding
import com.hunktimes.wholesale.util.L

/**
 * Author: Delete
 * Date: 2020/7/28 10:36
 * Description:
 *
 */
class OrderDetailFragment : BasePageFragment(R.layout.fragment_order_detail) {
    override val titleRes: Int
        get() = R.string.title_order_detail

    lateinit var viewBinding: FragmentOrderDetailBinding

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        viewBinding = FragmentOrderDetailBinding.bind(view)
    }

    override fun onStart() {
        super.onStart()
        initOrderGoods()
    }

    val orderItemGoodsAdapter = OrderDetailGoodsAdapter()
    fun initOrderGoods() {
        val orderItemGoodsLm = LinearLayoutManager(context)
        orderItemGoodsLm.orientation = LinearLayoutManager.VERTICAL
        viewBinding.orderDetailRcv.layoutManager = orderItemGoodsLm
        viewBinding.orderDetailRcv.adapter = orderItemGoodsAdapter


        val data = mutableListOf<String>()
        data.add("Order Goods 1")
        data.add("Order Goods 2")
        orderItemGoodsAdapter.data = data
    }
}

class OrderDetailGoodsAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_order_goods) {
    override fun convert(holder: BaseViewHolder, item: String) {
    }
}